Skip to content

Conversation

@bsbodden
Copy link
Collaborator

Reduces duplicate CLIENT SETINFO calls when creating an index from an existing Redis index by tracking client validation state.

When a client is validated in from_existing(), the _client_validated flag is set to prevent redundant validation in the property getter.

Addresses part of #358 by minimizing Redis command overhead during index initialization.

Reduces duplicate CLIENT SETINFO calls when creating an index from
an existing Redis index by tracking client validation state.

When a client is validated in from_existing(), the _client_validated
flag is set to prevent redundant validation in the property getter.

Addresses part of #358 by minimizing Redis command overhead during
index initialization.
@bsbodden bsbodden requested a review from Copilot September 30, 2025 20:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR optimizes Redis client initialization by eliminating duplicate CLIENT SETINFO calls when creating search indexes from existing Redis indexes. The optimization tracks client validation state to prevent redundant validation operations.

  • Introduced _client_validated parameter to track validation state across index initialization
  • Modified both sync and async from_existing() methods to set validation flag after client validation
  • Updated constructors to accept and use the validation state flag

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@bsbodden bsbodden self-assigned this Sep 30, 2025
@bsbodden bsbodden merged commit 52d38f4 into main Sep 30, 2025
37 checks passed
@bsbodden bsbodden deleted the bsb/issue-358 branch September 30, 2025 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants